import request from '@/utils/request'

// 查询BOM清单列表
export function listBom(query) {
  return request({
    url: '/yyj/gbs/bom/list',
    method: 'get',
    params: query
  })
}

export function allBom(query) {
  return request({
    url: '/yyj/gbs/bom/all',
    method: 'get',
    params: query
  })
}

// 查询BOM清单详细
export function getBom(query) {
  return request({
    url: '/yyj/gbs/bom/query',
    method: 'get',
    params: query
  })
}

export function getBomByPdCode(pdCode) {
  return request({
    url: '/yyj/gbs/bom/pdCode/' + pdCode,
    method: 'get'
  })
}

// 新增BOM清单
export function addBom(data) {
  return request({
    url: '/yyj/gbs/bom',
    method: 'post',
    data: data
  })
}

// 修改BOM清单
export function updateBom(data) {
  return request({
    url: '/yyj/gbs/bom',
    method: 'put',
    data: data
  })
}

// 删除BOM清单
export function delBom(bomCode) {
  return request({
    url: '/yyj/gbs/bom/' + bomCode,
    method: 'delete'
  })
}
